package com.zcz.umengpush;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.scheduling.annotation.EnableScheduling;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * @author 王卫帅
 */
@SpringBootApplication
@EnableDiscoveryClient
@MapperScan("com.zcz.umengpush.mapper")
@EnableSwagger2
//开启定时任务
@EnableScheduling
public class ZczUmengPushApplication extends SpringBootServletInitializer {
    //1.必须创建war项目，需要创建好web项目的目录。
    //2.嵌入式Tomcat依赖scope指定provided。
    // 3.编写SpringBootServletInitializer类子类,并重写configure方法。
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        // 注意这里要指向原先用main方法执行的Application启动类
        return builder.sources(ZczUmengPushApplication.class);
    }

     public static void main(String[] args) {
            SpringApplication.run(ZczUmengPushApplication.class);
        }

}
